!function(e,n,t,o){"use strict";t.behaviors.np_quick_search={attach:function(){const t=e("#navbar-top"),a=t.find(".search-wrapper"),s=t.find(".mobile-search"),i=t.find(".block-views-exposed-filter-blocknp-search-search-results"),r=o.createFocusTrap(".block-views-exposed-filter-blocknp-search-search-results"),c=i.find(".form-control"),d=i.find(".js-form-submit"),l=i.find(".views-exposed-form"),f=a.find("#close-mobile-search");c.prev("label").clone().insertBefore(d).attr("for",d.attr("id")),e(n(".search-wrapper","#navbar-top")).each((function(){function n(){c.attr({tabindex:0}),d.attr({tabindex:0}),l.find(".button-close").attr({tabindex:0})}function t(){c.attr({tabindex:-1}),d.attr({tabindex:-1}),l.find(".button-close").attr({tabindex:-1})}function o(){r.deactivate(),i.removeClass("opened"),a.removeClass("mobile-opened"),t()}function p(){np.isDesktop()?(o(),n(),e("#close-mobile-search").remove()):(t(),l.find(".button-close").length<1&&f.appendTo(l).on("click",(function(e){e.preventDefault(),o()})),s.on("click",(function(){i.addClass("opened"),a.addClass("mobile-opened"),n(),r.activate()})),i.on("keydown",(function(e){27===e.keyCode&&i.hasClass("opened")&&o()})),e(document).bind("mouseup touchend",(function(e){i.is(e.target)||0!==i.has(e.target).length||np.isDesktop()||o()})))}p(),np.resize(p)}))}}}(jQuery,once,Drupal,focusTrap);